﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ImportEnterpriseInfoByExcel.aspx.cs" Inherits="RN.ERP.Web.Enterprise.ImportEnterpriseInfoByExcel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="../Scripts/jquery-pack.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <div style=" text-align:left;">
            <ul style=" list-style:none;">
                <li>说明</li>
                <li>①点击【下载模板】，下载导入企业信息模板并按格式填写信息，请勿修改模板</li>
                <li>②点击【浏览】将填写好的模板文件上传</li>
                <li>&nbsp;</li>
                <li><a href="../Download/excel/corpinfo.xls">下载模板</a></li>
                <li>&nbsp;</li>
                <li>
                    <asp:FileUpload ID="fileUpload" ClientIDMode="Static" runat="server" />
                    <asp:Button ID="btnUpload" ClientIDMode="Static"  runat="server" Text="上传" style=" display:none;"
                        onclick="btnUpload_Click" />
                </li>
                <li>&nbsp;</li>
                <li id="liCorp" runat="server" style=" display:none;">
                
                未成功导入的企业如下：
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                </telerik:RadScriptManager>

                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
                    <AjaxSettings>
                        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                            <UpdatedControls>
                                <telerik:AjaxUpdatedControl ControlID="ListCorps" LoadingPanelID="RadAjaxLoadingPanel1" />
                            </UpdatedControls>
                        </telerik:AjaxSetting>
                    </AjaxSettings>
                </telerik:RadAjaxManager>
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

                <telerik:RadGrid ID="ListCorps" runat="server" AutoGenerateColumns="False" CellSpacing="0"
                        Width="730px" Culture="zh-CN" GridLines="None" AllowFilteringByColumn="false"
                        AllowPaging="false" AllowCustomPaging="false" AllowMultiRowSelection="true" OnNeedDataSource="ListCorps_NeedDataSource"
                        AllowSorting="false" ShowStatusBar="true">
                        <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
                            <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
                                AllowColumnResize="True"></Resizing>
                        </ClientSettings>
                        <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID">
                            <CommandItemSettings ExportToPdfText="导出PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                            </RowIndicatorColumn>
                            <Columns>

                                <telerik:GridBoundColumn DataField="CorpName" HeaderText="企业名称" HeaderStyle-Width="250px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="OrginazationCode" HeaderText="组织机构代码" HeaderStyle-Width="150px">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Description" HeaderText="错误描述" HeaderStyle-Width="300px">
                                </telerik:GridBoundColumn>
                                  
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                        </ClientSettings>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>

                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue" EnableShadow="true">
                </telerik:RadWindowManager>
                </li>
            </ul>
        </div>


    </div>
    </form>

    <script type="text/javascript">
        var fileExtensions = /(.xls|.xlsx)$/i;

        $("#fileUpload").change(function () {
            var fileName = this.value;

            $("#btnUpload").click();
//            if (fileExtensions.test(fileName)) {
//                $("#btnUpload").click();
//            } else {
//                alert("只能上传excel格式的文件！");
//                this.value = "";
//            }
        });

    </script>
</body>
</html>
